<template>
  <div class="bargain">
    <div class="bargain-top">
      <p class="kanjia">
        砍价活动
      </p>
      <p class="go"  @click="addGo">GO ></p>
    </div>
    <div class="bargain-item">
      <div
        v-for="item in images"
        :key="item.id"
      >
        <img
          :src="item.image"
          alt=""
          @click="bbb(item.id)"
        >
        <span class="title">{{item.otPrice}}
        </span>
        <span class="minprice">{{item.price}}</span>
        <p class="cykj">参与砍价</p>
      </div>
    </div>

  </div>
</template>
<script>
export default {
  data() {
    return {
      images: []
    }
  },
  methods: {
     addGo(){
       this.$router.push("/pages/activity/goods_bargain/index")
    },
    async getbargain() {
      const res = await this.$http.getbargain()
      console.log(res.data.data.productList);
      this.images = res.data.data.productList
    },
    bbb(id){
       this.$router.push(`/goods_combination_details/index?id=${id}`)
    }
  },
  created() {
    this.getbargain()
  }
}
</script>
<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}
.bargain {
  width: 100%;
  height: 240px;
  padding-left: 20px;
  box-sizing: border-box;
  padding-top: 20px;
  .bargain-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    .kanjia {
      font-size: 20px;
      font-weight: bold;
    }
    .go {
      width: 60px;
      height: 20px;
      text-align: center;
      background-color: #ffd6a7;
      color: #fe960f;
      margin-right: 3px;
      border-radius: 10px;
      font-weight: bold;
      font-size: 20px;
    }
  }
  .bargain-item {
    display: flex;
    overflow: auto hidden;
    font-size: 14px;
    height: 200px;
    img {
      height: 120px;
    }
  }
  .title {
    width: 140px;
    height: 20px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    text-decoration: line-through;
  }
  .minprice {
    color: red;
  }
  .cykj {
    width: 120px;
    height: 20px;
    border-radius: 0px 0px 5px 5px;
    text-align: center;
    background: linear-gradient(90deg, #ff7931, #e93323);
    color: white;
  }
}
</style>